package com.clf.common.util.enums;

/**
 * 操作返回码枚举
 * 
 * @author qinxin.
 */
public enum BizResultCodeEnum {

    SUCCESS(0, "操作成功"),
    
    REQUIRES_AUTH(1, "需要认证"),

    INSUFFICIEN_PERMISSIONS(2, "权限不足"),
	
	PARAMETER_ERROR(3,"请求参数错误"),
	
	UN_CHECK_ERROR(4,"系统异常"),

    PROCESSING(5, "处理中");
    
    private final int code;

    private final String msg;

    BizResultCodeEnum(int code, String msg){
        this.code = code;
        this.msg = msg;
    }

    public static BizResultCodeEnum getByCode(int code) {
        for (BizResultCodeEnum item : values()) {
            if (code==item.getCode()) {
                return item;
            }
        }
        return null;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
